// 使用 Mock
import Mock from 'mockjs'
import base from '../../request/base'
Mock.mock(base.baseUrl + 'getConfig', {
    columns: [
        {
            type: 'checkbox',
            title: 'ID',
            width: 60,
            treeNode: true,
            digits: 1
        },
        {
            type: 'seq',
            title: '#',
            width: 50
        },
        {
            type: 'expand',
            title: '明细',
            width: 50
        },
        {
            field: 'djlczt',
            sortable: false,
            title: '流程'
        },
        {
            type: 'ADatePicker',
            field: 'rq',
            title: '日期',
            rules: [
                {
                    required: true,
                    message: '请选择日期'
                }
            ]
        },
        {
            type: 'date',
            field: 'rqDate',
            title: '不带时间'
        },
        {
            type: 'dateTime',
            field: 'rqTime',
            title: '带时间'
        },
        {
            type: 'AInput',
            field: 'dh',
            title: '单号',
            digits: 3,
            rules: [
                {
                    required: true,
                    message: '请输入单号'
                }
            ],
            count: true
        },
        {
            type: 'ASelect',
            field: 'khbm',
            title: '客户编码',
            options: {
                options: [{
                    label: '选项一',
                    value: '选项一'
                }, {
                    label: '选项二',
                    value: '选项二'
                }]
            },
            rules: [
                {
                    required: true,
                    message: '请选择客户编码'
                }
            ]
        },
        {
            type: 'AInputSearch',
            field: 'khmc',
            title: '客户名称',
            width: 135,
            suffix: 'search',
            filterable: true,
            rules: [
                {
                    required: true,
                    message: '不能为空'
                }
            ]
        },
        {
            type: 'html',
            field: 'lxdh',
            title: '联系电话',
            visible: true
        },
        {
            field: 'shdz',
            title: '送货地址'
        },
        {
            field: 'shsjd',
            title: '送货时间段',
            width: 60
        },
        {
            field: 'xszje',
            title: '销售总金额',
            width: 60,
            count: true
        },
        {
            field: 'wlzt',
            title: '物流状态',
            width: 80
        }
    ]
})
Mock.mock(base.baseUrl + 'getTreeList', {
    list: [
        {
            title: '销售订单',
            key: '0-0',
            children: [
                {
                    title: '销售订单-制定',
                    key: '1',
                    disabled: false
                },
                {
                    title: '销售订单-店长审批',
                    key: '2'
                },
                {
                    title: '销售订单-经理审批',
                    key: '3'
                },
                {
                    title: '销售订单-总经理审批',
                    key: '4'
                },
                {
                    title: '99生效/归档',
                    key: '5'
                }
            ]
        }
    ]
})
Mock.mock(base.baseUrl + 'getProgramme', {
    list: [
        {
            id: 1,
            name: '当日方案'
        },
        {
            id: 2,
            name: '当年方案'
        },
        {
            id: 3,
            name: '当周方案'
        },
        {
            id: 4,
            name: '其他方案一'
        },
        {
            id: 5,
            name: '其他方案二'
        }
    ]
})
Mock.mock(base.baseUrl + 'getDetailConfig', {
    border: true,
    columns: [
        {
            type: 'checkbox',
            title: 'ID',
            width: 60
        },
        {
            type: 'seq',
            title: '#',
            width: 70,
            sortable: true
        },
        {
            type: 'alert',
            field: 'pjmx',
            title: '配件明细'
        },
        {
            field: 'spbm',
            sortable: true,
            title: '商品编码'
        },
        {
            field: 'spmc',
            sortable: true,
            title: '商品名称'
        },
        {
            field: 'sl',
            title: '数量',
            sortable: false
        },
        {
            field: 'sh',
            title: '色号',
            width: 80
        },
        {
            field: 'dj',
            title: '单价',
            width: 80
        },
        {
            field: 'wlzt',
            title: '物流状态',
            width: 80,
            type: 'html',
            visible: true
        },
        {
            field: 'zhje',
            title: '折后金额',
            width: 80,
            visible: true
        },
        {
            field: 'bz',
            title: '备注'
        }
    ],
    // tabPosition: 1,
    mx: [{
        id: 1,
        title: '销售订单明细'
    }, {
        id: 2,
        title: '其他明细'
    }]
})
Mock.mock(base.baseUrl + 'getList', {
    'list|15': [
        {
            'children|2': [{
                'id|+1': 1,
                djlczt: '销售订单-制定',
                'dh|+1': ['34', '25', '3245', '97'],
                khbm: 'KD22324',
                khmc: '客户小维',
                lxdh: '13128326888',
                shdz: '广东省广州市天河区XX区05号',
                shsjd: '下午',
                xszje: 12800
            }],
            hasChild: true,
            'id|+1': 1,
            djlczt: '销售订单-制定',
            'dh|+1': 23443428,
            khbm: 'KD22324',
            khmc: '客户小维',
            lxdh: '13128326888',
            shdz: '广东省广州市天河区XX区05号',
            shsjd: '下午',
            xszje: 12800,
            wlzt: '<a target="_self" onclick="sWin(\'FXXSDD.ASPX?Tsystem_id=2017010209560662900whfx2641\');"  href="####">编辑</a>'
        }
    ],
    page: {
        currentPage: 1,
        total: 100,
        pageSize: 10
    }

})
Mock.mock(base.baseUrl + 'getDetailList', {
    'list|5': [{
        'id|+1': 1,
        pjmx: '查看',
        spbm: 'CH2353636',
        spmc: '全抛釉地砖金叶米黄',
        sl: 53,
        sh: 'AA',
        dj: 10,
        zhje: 1890,
        wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: green">出库+8</a>',
        bz: '是'
    }
    ],
    page: {
        currentPage: 1,
        total: 100,
        pageSize: 10
    }
})
Mock.mock(base.baseUrl + 'getSonConfig', {
    columns: [
        {
            type: 'seq',
            title: '#',
            width: 50,
            slots: {}
        },
        {
            field: 'pjspbm',
            title: '配件商品编码',
            slots: {}
        },
        {
            field: 'pjspmc',
            title: '配件商品名称',
            slots: {}
        },
        {
            field: 'sl',
            title: '数量',
            slots: {}
        },
        {
            field: 'sh',
            title: '色号',
            slots: {}
        },
        {
            field: 'wlzt',
            title: '物流状态',
            type: 'html',
            slots: {}
        },
        {
            field: 'bz',
            title: '备注',
            slots: {}
        }
    ]
})
Mock.mock(base.baseUrl + 'getSonList', {
    list: [
        {
            hasChild: true,
            id: 1,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 10,
            sh: 'BC',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_72',
            children: null
        },
        {
            hasChild: true,
            id: 2,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 22,
            sh: 'AB',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_73',
            children: null
        },
        {
            hasChild: true,
            id: 3,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 34,
            sh: 'AB',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_74',
            children: null
        },
        {
            hasChild: true,
            id: 4,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 46,
            sh: 'BC',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_75',
            children: null
        },
        {
            hasChild: true,
            id: 5,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 58,
            sh: 'AB',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_76',
            children: null
        },
        {
            hasChild: true,
            id: 6,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 70,
            sh: 'BC',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_77',
            children: null
        },
        {
            hasChild: true,
            id: 7,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 82,
            sh: 'AB',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_78',
            children: null
        },
        {
            hasChild: true,
            id: 8,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 94,
            sh: 'BC',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_79',
            children: null
        },
        {
            hasChild: true,
            id: 9,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 106,
            sh: 'BC',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_80',
            children: null
        },
        {
            hasChild: true,
            id: 10,
            pjspbm: 'BM15263262',
            pjspmc: '全抛釉地砖金玉米黄',
            sl: 118,
            sh: 'AD',
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: orange">入库+8</a>',
            bz: 'xxx备注',
            _XID: 'row_81',
            children: null
        }
    ],
    page: {
        currentPage: 1,
        total: 100,
        pageSize: 10
    }
})
Mock.mock(base.baseUrl + 'getOneLevelConfig', {
    columns: [
        {
            type: 'checkbox',
            title: 'ID',
            width: 60,
            treeNode: true
        },
        {
            type: 'seq',
            title: '#',
            width: 50
        },
        {
            field: 'djlczt',
            sortable: true,
            title: '流程'
        },
        {
            field: 'rq',
            title: '日期'
        },
        {
            field: 'dh',
            title: '单号'
        },
        {
            field: 'khbm',
            title: '客户编码'
        },
        {
            field: 'khmc',
            title: '客户名称'
        },
        {
            field: 'lxdh',
            title: '联系电话',
            visible: true
        },
        {
            field: 'shdz',
            title: '送货地址'
        },
        {
            field: 'shsjd',
            title: '送货时间段',
            width: 60
        },
        {
            field: 'xszje',
            title: '销售总金额',
            width: 60
        },
        {
            field: 'wlzt',
            type: 'html',
            title: '物流状态',
            width: 80
        },
        {
            field: 'pjmx',
            title: '配件明细'
        },
        {
            field: 'spbm',
            sortable: true,
            title: '商品编码'
        },
        {
            field: 'spmc',
            sortable: true,
            title: '商品名称'
        },
        {
            field: 'sl',
            title: '数量',
            sortable: false
        },
        {
            field: 'sh',
            title: '色号',
            width: 80
        },
        {
            field: 'dj',
            title: '单价',
            width: 80
        },
        {
            field: 'wlztson',
            title: '物流状态',
            width: 80,
            type: 'html',
            visible: true
        },
        {
            field: 'zhje',
            title: '折后金额',
            width: 80,
            visible: true
        },
        {
            field: 'bz',
            title: '备注'
        }
    ]
})
Mock.mock(base.baseUrl + 'getOneLevelList', {
    'list|6': [
        {
            hasChild: true,
            'id|1': 1,
            djlczt: '工作日志-制定',
            rq: '2020/2/10',
            dh: 23443428,
            khbm: 'KD22324',
            khmc: '客户小维',
            lxdh: '13128326888',
            shdz: '广东省广州市天河区XX区05号',
            shsjd: '下午',
            xszje: 12800,
            wlzt: '<a href="https://www.baidu.com" class="link" target="_black" style="color: green">入库+8</a>',
            pjmx: '查看',
            spbm: 'CH2353636',
            spmc: '全抛釉地砖金叶米黄',
            sl: 53,
            sh: 'AA',
            dj: 10,
            zhje: 1890,
            wlztson: '<a href="https://www.baidu.com" class="link" target="_black" style="color: green">出库+8</a>',
            bz: '是'
        }
    ],
    page: {
        currentPage: 1,
        total: 100,
        pageSize: 10
    }
})
Mock.mock(base.baseUrl + 'delete', {
    msg: 'ok'
})
Mock.mock(base.baseUrl + 'getRowSpanConfig', {
    columns: [
        {
            type: 'checkbox',
            width: 60
        },
        {
            field: 'id',
            title: 'ID'
        },
        {
            field: 'djlczt',
            sortable: true,
            title: '流程'
        },
        {
            field: 'rq',
            title: '日期'
        }
    ],
    rowSpanFields: ['djlczt', 'rq', 'id']
})
Mock.mock(base.baseUrl + 'getRowSpanList', {
    list: [
        {
            id: 1,
            djlczt: '销售订单-制定1',
            rq: '2020/10/1'
        },
        {
            id: 1,
            djlczt: '销售订单-制定1',
            rq: '2020/10/2'
        },
        {
            id: 2,
            djlczt: '销售订单-制定1',
            rq: '2020/10/5'
        },
        {
            id: 2,
            djlczt: '销售订单-制定3',
            rq: '2020/10/5'
        },
        {
            id: 3,
            djlczt: '销售订单-制定1',
            rq: '2020/10/5'
        }
    ],
    page: {
        currentPage: 1,
        total: 100,
        pageSize: 10
    }

})
